<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>fpathconf</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_005_176">&nbsp;</a>NAME</h4><blockquote>
fpathconf, pathconf - get configurable pathname variables
</blockquote><h4><a name = "tag_000_005_177">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;

long int fpathconf(int <i>fildes</i>, int <i>name</i>);
long int pathconf(const char *<i>path</i>, int <i>name</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_005_178">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>fpathconf()</i>
and
<i>pathconf()</i>
functions provide a method for the application to determine
the current value of a configurable limit or option
(<i>variable</i>)
that is associated with a file or directory.
<p>
For
<i>pathconf()</i>,
the
<i>path</i>
argument points to the pathname of a file or directory.
<p>
For
<i>fpathconf()</i>,
the
<i>fildes</i>
argument is an open file descriptor.
<p>
The
<i>name</i>
argument represents the variable to be queried
relative to that file or directory.
Implementations will support all of the variables listed in
the following table and may support others.
The variables in the following table come from
<i><a href="limits.h.html">&lt;limits.h&gt;</a></i>
or
<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>
and the symbolic constants, defined in
<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>,
are the corresponding values used for
<i>name:</i>
<p><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Variable</b>
<th align=center><b>Value of <i>name</i></b>
<th align=center><b>Notes</b>
<tr valign=top><td align=left>FILESIZEBITS
<td align=left>_PC_FILESIZEBITS
<td align=left>3,4
<tr valign=top><td align=left>LINK_MAX
<td align=left>_PC_LINK_MAX
<td align=left>1
<tr valign=top><td align=left>MAX_CANON
<td align=left>_PC_MAX_CANON
<td align=left>2
<tr valign=top><td align=left>MAX_INPUT
<td align=left>_PC_MAX_INPUT
<td align=left>2
<tr valign=top><td align=left>NAME_MAX
<td align=left>_PC_NAME_MAX
<td align=left>3,4
<tr valign=top><td align=left>PATH_MAX
<td align=left>_PC_PATH_MAX
<td align=left>4,5
<tr valign=top><td align=left>PIPE_BUF
<td align=left>_PC_PIPE_BUF
<td align=left>6
<tr valign=top><td align=left>_POSIX_CHOWN_RESTRICTED
<td align=left>_PC_CHOWN_RESTRICTED
<td align=left>7
<tr valign=top><td align=left>_POSIX_NO_TRUNC
<td align=left>_PC_NO_TRUNC
<td align=left>3,4
<tr valign=top><td align=left>_POSIX_VDISABLE
<td align=left>_PC_VDISABLE
<td align=left>2
<tr valign=top><td align=left>_POSIX_ASYNC_IO
<td align=left>_PC_ASYNC_IO
<td align=left>8
<tr valign=top><td align=left>_POSIX_PRIO_IO
<td align=left>_PC_PRIO_IO
<td align=left>8
<tr valign=top><td align=left>_POSIX_SYNC_IO
<td align=left>_PC_SYNC_IO
<td align=left>8
</table>
<dl><dt><b>Notes:</b>
<dd><ol>
<p>
<li>
If
<i>path</i>
or
<i>fildes</i>
refers to a directory, the value returned applies to the directory itself.
<p>
<li>
If
<i>path</i>
or
<i>fildes</i>
does not refer to a terminal file,
it is unspecified whether an
implementation supports an association of the variable name with
the specified file.
<p>
<li>
If
<i>path</i>
or
<i>fildes</i>
refers to a directory, the value returned applies to
filenames within the directory.
<p>
<li>
If
<i>path</i>
or
<i>fildes</i>
does not refer to a directory,
it is unspecified whether an
implementation supports an association of the variable name with
the specified file.
<p>
<li>
If
<i>path</i>
or
<i>fildes</i>
refers to a directory, the value returned is the maximum length of
a relative pathname when the specified directory is the
working directory.
<p>
<li>
If
<i>path</i>
refers to a FIFO, or
<i>fildes</i>
refers to a pipe or FIFO, the value returned applies to the referenced
object.  If
<i>path</i>
or
<i>fildes</i>
refers to a directory, the value returned applies to any FIFO that exists or
can be created within the directory.  If
<i>path</i>
or
<i>fildes</i>
refers to any other type of file, it is unspecified whether an implementation
supports an association of the variable name with the specified file.
<p>
<li>
If
<i>path</i>
or
<i>fildes</i>
refers to a directory, the value returned applies to any files, other than
directories, that exist or can be created within the directory.
<p>
<li>
If 
<i>path</i>
or
<i>fildes</i>
refers to a directory, it is unspecified whether an implementation
supports an association of the variable name with the specified file.
<p>
</ol>
</dl>
</blockquote><h4><a name = "tag_000_005_179">&nbsp;</a>RETURN VALUE</h4><blockquote>
If
<i>name</i>
is an invalid value, both
<i>pathconf()</i>
and
<i>fpathconf()</i>
return -1 and
<i>errno</i>
is set to indicate the error.
<p>
If the variable corresponding to
<i>name</i>
has no limit for the
<i>path</i>
or file descriptor, both
<i>pathconf()</i>
and
<i>fpathconf()</i>
return -1 without changing
<i>errno</i>.
If the implementation needs to use
<i>path</i>
to determine the value of
<i>name</i>
and the implementation does not support the
association of
<i>name</i>
with the file specified by
<i>path</i>,
or if the process did not have appropriate privileges to query the
file specified by
<i>path</i>,
or
<i>path</i>
does not exist,
<i>pathconf()</i>
returns -1 and
<i>errno</i>
is set to indicate the error.
<p>
If the implementation needs to use
<i>fildes</i>
to determine the value of
<i>name</i>
and the implementation does not support the
association of
<i>name</i>
with the file specified by
<i>fildes</i>,
or if
<i>fildes</i>
is an invalid file descriptor,
<i>fpathconf()</i>
will return -1 and
<i>errno</i>
is set to indicate the error.
<p>
Otherwise
<i>pathconf()</i>
or
<i>fpathconf()</i>
returns the current variable value for the file or directory without changing
<i>errno</i>.
The value returned will not be more restrictive than the
corresponding value available to the application when it
was compiled with the implementation's
<i><a href="limits.h.html">&lt;limits.h&gt;</a></i>
or
<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.
</blockquote><h4><a name = "tag_000_005_180">&nbsp;</a>ERRORS</h4><blockquote>
The
<i>pathconf()</i>
function will fail if:
<dl compact>

<dt>[EINVAL]<dd>
The value of
<i>name</i>
is not valid.

<dt>[ELOOP]<dd>
Too many symbolic links were encountered in resolving <i>path</i>.

</dl>
<p>
The
<i>pathconf()</i>
function may fail if:
<dl compact>

<dt>[EACCES]<dd>
Search permission is denied for a component of the path prefix.

<dt>[EINVAL]<dd>
The implementation does not support an association of the variable
<i>name</i>
with the specified file.

<dt>[ENAMETOOLONG]<dd>

The length of the
<i>path</i>
argument exceeds {PATH_MAX}
or a pathname component is longer than {NAME_MAX}.

<dt>[ENAMETOOLONG]<dd>

Pathname resolution of a symbolic link produced an intermediate result whose
length exceeds {PATH_MAX}.

<dt>[ENOENT]<dd>
A component of <i>path</i> does not name an existing file
or <i>path</i> is an empty string.

<dt>[ENOTDIR]<dd>
A component of the path prefix is not a directory.

</dl>
<p>
The
<i>fpathconf()</i>
function will fail if:
<dl compact>

<dt>[EINVAL]<dd>
The value of
<i>name</i>
is not valid.

</dl>
<p>
The
<i>fpathconf()</i>
function may fail if:
<dl compact>

<dt>[EBADF]<dd>
The
<i>fildes</i>
argument is not a valid file descriptor.

<dt>[EINVAL]<dd>
The implementation does not support an association of the variable
<i>name</i>
with the specified file.

</dl>
</blockquote><h4><a name = "tag_000_005_181">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_182">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_183">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_005_184">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="confstr.html">confstr()</a></i>,
<i><a href="sysconf.html">sysconf()</a></i>,
<i><a href="limits.h.html">&lt;limits.h&gt;</a></i>,
<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>,
the <b>XCU</b> specification of <i><a href="../xcu/getconf.html">getconf</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the POSIX.1-1988 standard.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

